package com.wiscamp.ninechapters.problems.math;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 五边形表示
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class LatexPentagonDenote extends LatexGeometryDenote {
    /**
     * 起始顶点
     */
    private char startVertex;

    /**
     * 第二顶点
     */
    private char middleOneVertex;

    /**
     * 第三顶点
     */
    private char middleTwoVertex;

    /**
     * 第四顶点
     */
    private char middleThreeVertex;

    /**
     * 结束顶点
     */
    private char endVertex;


    public String getLatex() {
        String temp = String.valueOf(startVertex) + middleOneVertex + middleTwoVertex + middleThreeVertex + endVertex;
        return temp.toUpperCase();
    }

    public LatexPentagonDenote(char startVertex, char middleOneVertex, char middleTwoVertex, char middleThreeVertex, char endVertex) {
        this.startVertex = startVertex;
        this.middleOneVertex = middleOneVertex;
        this.middleTwoVertex = middleTwoVertex;
        this.middleThreeVertex = middleThreeVertex;
        this.endVertex = endVertex;
    }

    public LatexPentagonDenote(String content) {
        if (content.length() == 5) {
            var array = content.toCharArray();
            this.startVertex = array[0];
            this.middleOneVertex = array[1];
            this.middleTwoVertex = array[2];
            this.middleThreeVertex = array[3];
            this.endVertex = array[4];
        }
    }


}
